/*
 * Copyright (c) 2018. czmc All Rights Reserved.
 * Author: czmc
 * Email: zxc6355533@163.com
 * Encoding: UTF-8
 */

package top.stime21.myneighbours.module.login.model

import io.reactivex.Observable
import top.stime21.myneighbours.api.ApiManager
import top.stime21.myneighbours.base.io_main
import top.stime21.myneighbours.data.dto.BaseResult
import top.stime21.myneighbours.data.dto.UserResult
import top.stime21.myneighbours.module.login.LoginContract

/**
 * Author: czmc  Email: @tuwan21.com
 * Version:	1.0  Date:3/3/2018
 */
class LoginModelImpl : LoginContract.Model{
    override fun sendSms(mobile: String): Observable<BaseResult> {
        return ApiManager.ins().dataApi.sendsms(mobile).io_main()
    }

    override fun login(mobile: String, vcode: String): Observable<UserResult> {
        return ApiManager.ins().dataApi.phonelogin(mobile,vcode).io_main()
    }
}